import numpy as np

from girth.synthetic import create_synthetic_irt_dichotomous
from girth import twopl_mml

if __name__ == '__main__':
    # Create Synthetic Data
    difficulty = np.linspace(-2.5, 2.5, 10)
    discrimination = np.random.rand(10) + 0.5
    theta = np.random.randn(500)

    syn_data = create_synthetic_irt_dichotomous(difficulty, discrimination, theta)

    # Solve for parameters
    estimates = twopl_mml(syn_data)

    # Unpack estimates
    discrimination_estimates = estimates['Discrimination']
    difficulty_estimates = estimates['Difficulty']
    print(discrimination, difficulty)